home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / comms / other / magicfile / xtruderfilecheck.rx < prev   
Text File  |  1999-04-21  |  2KB  |  64 lines

  1. /* 
  2.    $VER: MagicFile 4.5 Xtruder Virus Checker AREXX ©1997 Steve Clack 1.1
  3.    
  4.    This may be freely distributed and mutated!
  5.       
  6.    Template: XtruderFileCheck.rx <no arguments yet>
  7.         
  8.    If Xtruder is not running, it will be started from the script.
  9. */
  10.  
  11. Prog_Xtruder = "SYS:System/Xtruder/Xtruder" /* << Change this to where your Xtruder is! */
  12.  
  13. options results
  14. options failat 99
  15.  
  16. if ~show(ports,XTRUDER) then do
  17.      address command Prog_Xtruder
  18.      StartTime = time(seconds)
  19.      do while ~show(ports,XTRUDER)
  20.           if time(seconds) - StartTime > 20 then do
  21.                address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'Time()' 'Date()' serious problem occoured:"'
  22.                address command 'Echo >>BBS:Logfiles/MFVirusLog.text "Failed to load Xtruder! Files have been untouched!*n"'
  23.                exit
  24.           end
  25.      end
  26. end
  27.  
  28. address XTRUDER HIDE
  29.  
  30. call open(checkfile,'T:MFCheckQueue',R)
  31. DO UNTIL EOF(checkfile)
  32.   Line = READLN(checkfile)
  33.   IF UPPER(WORD(Line,1)) = "%" THEN DO
  34.    USERNAME = READLN(checkfile)
  35.    DESTPATH = READLN(checkfile)
  36.    Line = READLN(checkfile)
  37.   END
  38.  
  39.   IF Line ~= "" then do
  40.    address XTRUDER CHECKFILES Line
  41.    status = rc
  42.    
  43.    if status<0 then do
  44.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'Time()' 'Date()' serious problem occoured:"'
  45.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "Failed to virus check >'Line'< uploaded by 'USERNAME'!*n"'
  46.       address command 'Copy CLONE >nil: 'Line' 'DESTPATH
  47.    end
  48.    
  49.    if status=0 then do
  50.       address command 'Copy CLONE >nil: 'Line' 'DESTPATH
  51.    end
  52.  
  53.    if status>0 then do
  54.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'Time()' 'Date()' incident occoured:"'
  55.       address command 'Echo >>BBS:Logfiles/MFVirusLog.text "'USERNAME' uploaded virus infected >'Line'< - 'status' viruses found!*n"'
  56.    end
  57.  
  58.   address command 'Delete >nil: 'Line
  59.   END
  60. END
  61. call close checkfile
  62. address command 'Delete >nil: T:MFCheckQueue'
  63. exit
  64.